package cn.longwingstech.intelligence.agent.app.memory;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class ChatEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 会话的角色类型
     */
    private String type;

    /**
     * 会话内容
     */
    private String text;

    // 防止序列化时的循环引用
    @Override
    public String toString() {
        return "ChatEntity{" +
                "type='" + type + '\'' +
                ", text='" + (text != null ? text.substring(0, Math.min(text.length(), 100)) : "null") + '\'' +
                '}';
    }
}
